<template>
    <div class="input">
        <input type="text" class="inp" v-model="inpVal" placeholder="请输入">
        <button class="but" @click="add">提交</button>
    </div>
</template>

<script>
export default {
    components: {},
    data() {
        return {
            inpVal:''
        }
    },
    props: {},
    computed: {},
    methods: {
        add(){
            let obj = { title: this.inpVal,status:0 }
            this.$store.commit('add', obj)
            this.inpVal = ''
        }
    },
}
</script>
<style scoped lang='scss'>

.input {
    width: 100%;
    height: 50px;
    text-align: center;
    line-height: 50px;

    .inp {
        width: 60%;
        height: 30px;
        outline: none;
    }

    .but {
        width: 70px;
        height: 30px;
        background-color: aqua;
        margin-left: 10px;
        border: none;
        border-radius: 5px;
    }
}
</style>
